package controll;

import java.io.IOException;
import java.util.Map;

import org.nutz.dao.Cnd;

import com.guava.framework.Controller;

import config.GHelper;
import pojo.nutz.Blogpage;
import pojo.nutz.User_model;
import pojo.nutz.Zbsz_model;

/**
 * Zbsz：整备手帐
 * 构成部分：title category [pic/comment	...	pic/comment]
 */
public class Zbsz extends Controller {

	public void addform() throws IOException {
		pojo.nutz.Zbsz zobj=new pojo.nutz.Zbsz();
		zobj.cat_=3;
		zobj.title="预设标题";
		zobj.userid=(int) getSessionAttr("userid");
		Zbsz_model model = new Zbsz_model(getDao());
		model.save(zobj);
		setAttr("id", zobj.id);
		render("zhengbeishouzhang_add.html");
	}
	public void add() throws IOException {
		  Map<String, String[]> params = GHelper.request.getParameterMap();
	        String queryString = "";
	        for (String key : params.keySet()) {
	            String[] values = params.get(key);
	            for (int i = 0; i < values.length; i++) {
	                String value = values[i];
	                queryString += key + "=" + value + "&";
	                System.out.println(key+" key "+value);
	            }
	        }
	        
//	        System.out.println(GHelper.request.getParameter("title")+"guava");
	}

}
